<template>
	<view>
		<view class="user_top">
			<view class="user_top_title">我的</view>
		</view>
		<view class="user_message" @click="loginMen()">
			<view class="flex  align-center">
				<image :src="userIofo.avatar?userIofo.avatar:'/static/userImg.png'" mode="aspectFill"
					class="user_avatar animation-scale-up"></image>
				<view class="margin-left">
					<view class="user_name">{{userIofo !=0 ?userIofo.nickname:'请登录'}}</view>
					<view class="user_table margin-tb-xs"v-if="userIofo.realname_or ==0" >未认证</view>
					<view class="user_table margin-tb-xs"v-if="userIofo.realname_or ==1"  style="background-color: #00D88F;">已认证</view>
					<view class="flex justify-between align-center" style="width: 450rpx;">
						<view>
							<!-- <text class="user_num">关注：279</text>
							<text class="user_num margin-lr">粉丝：845</text> -->
						</view>
						<image src="/static/user/imgerweima.png" mode="widthFix" style="width: 36rpx;"
							@click="$tools.push('/pages/user/modules/share')"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="margin radius bg-white" style="overflow: hidden;">
			<view class="plugins padding  solid-bottom" v-for="(item,index) in pluginsList" :key='index'
				@click="$tools.push(item.toUrl)" hover-class="bg-gray" v-if="userIofo.realname_or>0?index!=0:index!=111 ">
				<view class="align-center">
					<image :src="item.icon" mode="" class="plugins_image animation-scale-up "></image>
					<view class="margin-left">{{item.title}}</view>
				</view>
				<view class="cuIcon-right"></view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserInfo
	} from '../../common/path.js'
	export default {
		data() {
			return {
				pluginsList: [{
						title: '企业认证',
						icon: '/static/user/imgqiye-1.png',
						toUrl: '/pages/user/modules/certification'
					},
					{
						title: '电子协议',
						icon: '/static/user/imgdainzi.png',
						toUrl: '/pages/user/modules/agreement'
					},
					{
						title: '隐私政策说明',
						icon: '/static/user/imgyinsi.png',
						toUrl: '/pages/plugins/privacyAgreement?type=2'
					},
					{
						title: '新手指南',
						icon: '/static/user/imgxinshou.png',
						toUrl: '/pages/workbench/modules/articleList'
					},
				
					{
						title: '分享',
						icon: '/static/user/imgyaoqing.png',
						toUrl: '/pages/user/modules/share'
					},
					{
						title: '保入职',
						icon: '/static/workbench/icon_baoruzhi.png',
						toUrl: '/pages/user/modules/baoruzhi'
					},
					{
						title: '设置',
						icon: '/static/user/imgshezhi.png',
						toUrl: '/pages/user/modules/setting'
					},
					
					
				],
				//用户信息
				userIofo: 0
			}
		},
		onLoad() {},
		onShow() {
			this.getUserInfo()
		},

		methods: {
			//登录
			loginMen() {
				if (this.userIofo == 0) {
					uni.navigateTo({
						url: '../login/loginTwo'
					})
				} else {

				}
			},

			//用户信息
			getUserInfo() {
				this.Http.POST(getUserInfo, {})
					.then(res => {
						if (res.code == 1) {
							console.log('[用户信息]', res);
							this.userIofo = res.data
							uni.setStorageSync('userIofo', res.data)
						} else {
							this.userIofo = 0
							this.$tools.showToast(res.msg)
						}
					})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #F6F6F6;
	}

	.user_top {
		width: 750rpx;
		height: 361rpx;
		background-image: url(../../static/user/imgwode-2.png);
		background-size: 100% 100%;
	}

	.user_top_title {
		font-size: 48rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
		opacity: 1;
		padding: 30rpx;
	}

	//用户信息
	.user_message {
		width: 710rpx;
		height: 370rrpx;
		background: #FFFFFF;
		box-shadow: 0px 4rpx 11rpx rgba(0, 93, 122, 0.09);
		border-radius: 20rpx;
		background-color: white;
		margin: 0 auto;
		margin-top: -200rpx;
		padding: 30rpx;
		z-index: 1;
	}

	.user_avatar {
		width: 140rpx;
		height: 140rpx;
		// background: #D8D8D8;
		// border: 1rpx solid #FFFFFF;
		box-shadow: 0px 3rpx 8rpx rgba(0, 0, 0, 0.13);
		border-radius: 50%;
		opacity: 1;
	}

	.user_name {
		width: 260rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #434343;
		opacity: 1;
	}

	.user_table {
		width: 100rpx;
		height: 38rpx;
		background: #E6716D;
		opacity: 1;
		border-radius: 19rpx;
		line-height: 38rpx;
		text-align: center;
		font-size: 20rpx;
		color: white;
	}

	.user_num {
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #999999;
		opacity: 1;
	}

	.user_order {
		width: 44rpx;
		height: 44rpx;
	}

	.user_money {
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #E6716D;
		opacity: 1;
	}

	.user_plugins_title {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #343436;
		opacity: 1;
	}

	.plugins {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.plugins_image {
		width: 46rpx;
		height: 46rpx;
		opacity: 1;
	}
</style>
